{
 "metadata": {
  "name": "",
  "signature": "sha256:9b67a4eac3f1e33cbbfac5318e6bc4298d31615f0abce086d6000ea25b106389"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Introduction\n",
      "-------------------\n",
      "\n",
      "Brzezniak (2000) is a great book because it approaches conditional expectation through a sequence of exercises, which is what we are trying to do here. The main difference is that Brzezniak takes a more abstract measure-theoretic approach to the same problems. Note that you *do* need to grasp the measure-theoretic to move into more advanced areas in stochastic processes, but for what we have covered so far, working the same problems in his text using our methods is illuminating. It always helps to have more than one way to solve *any* problem.  I urge you to get a copy of his book or at least look at some pages on Google Books. I have numbered the examples corresponding to the book. "
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Examples\n",
      "-------------\n",
      "\n",
      "This is Example 2.1 from Brzezniak:\n",
      "\n",
      "> Three coins, 10p, 20p and 50p are tossed. The values of those coins that land heads up are added to work out the total amount. What is the expected total amount given that two coins have landed heads up?\n",
      "\n",
      "In this case we have we want to compute $\\mathbb{E}(\\xi|\\eta)$ where\n",
      "\n",
      "$$ \\xi = 10 X_{10} + 20 X_{20} +50 X_{50} $$\n",
      "\n",
      "where $X_i \\in \\{ 0,1\\} $. This represents the sum total value of the heads-up coins. The $\\eta$ represents the fact that only two of the three coins are heads-up. Note \n",
      "\n",
      "$$\\eta = X_{10} X_{20} (1-X_{50})+ (1-X_{10}) X_{20} X_{50}+ X_{10} (1-X_{20}) X_{50} $$\n",
      "\n",
      "is a function that is only non-zero when two of the three coins is heads. Each triple term catches each of these three possibilities. For example, the first term is when the 10p and 20p are heads up  and the 50p is heads down.\n",
      "\n",
      "To compute the conditional expectation, we want to find a function $h$ of $\\eta$ that minimizes the MSE\n",
      "\n",
      "$$ \\sum_{X\\in\\{0,1\\}^3} \\frac{1}{8} (\\xi - h( \\eta ))^2 $$\n",
      "\n",
      "where the sum is taken over all possible triples of outcomes for $ \\{X_{10} , X_{20} ,X_{50}\\}$ and the $\\frac{1}{8} = \\frac{1}{2^3} $ since each coin has a $\\frac{1}{2}$ chance of coming up heads.\n",
      "\n",
      "Now, the question boils down to what function $h(\\eta)$ should we try? Note that $\\eta \\in \\{0,1\\}$ so $h$ takes on only two values. Thus, we only have to try $h(\\eta)=\\alpha \\eta$  and find $\\alpha$. Writing this out gives,\n",
      "\n",
      "$$ \\sum_{X\\in\\{0,1\\}^3} \\frac{1}{8} (\\xi - \\alpha( \\eta ))^2 $$\n",
      "\n",
      "\n",
      "which boils down to solving for $\\alpha$,\n",
      "\n",
      "$$\\langle \\xi , \\eta \\rangle = \\alpha \\langle \\eta,\\eta \\rangle$$\n",
      "\n",
      "where \n",
      "\n",
      "$$ \\langle \\xi , \\eta \\rangle =\\sum_{X\\in\\{0,1\\}^3} \\frac{1}{8} (\\xi  \\eta ) $$\n",
      "\n",
      "This is tedious and a perfect job for `sympy`.\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import sympy as S\n",
      "\n",
      "eta = S.Symbol('eta')\n",
      "xi = S.Symbol('xi')\n",
      "X10 = S.Symbol('X10')\n",
      "X20 = S.Symbol('X20')\n",
      "X50 = S.Symbol('X50')\n",
      "\n",
      "eta = X10 * X20 *(1-X50 )+ X10 * (1-X20) *(X50 )+ (1-X10) * X20 *(X50 )\n",
      "xi = 10*X10 +20* X20+ 50*X50 \n",
      "\n",
      "num=S.summation(xi*eta,(X10,0,1),(X20,0,1),(X50,0,1))\n",
      "den=S.summation(eta*eta,(X10,0,1),(X20,0,1),(X50,0,1))\n",
      "alpha=num/den\n",
      "print alpha"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "160/3\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "This means that\n",
      "\n",
      "$$ \\mathbb{E}(\\xi|\\eta) = \\frac{160}{3} \\eta $$\n",
      "\n",
      "which we can check with a quick simulation"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import numpy as np\n",
      "from numpy import array\n",
      "\n",
      "x=np.random.randint(0,2,(3,5000))\n",
      "print (160/3.,np.dot(x[:,x.sum(axis=0)==2].T,array([10,20,50])).mean())\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(53.333333333333336, 53.243528790279981)\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Example\n",
      "--------\n",
      "\n",
      "This is example 2.2:\n",
      "\n",
      "> Three coins, 10p, 20p and 50p are tossed as before. What is the conditional expectation of the total amount shown by the three coins given the total amount shown by the 10p and 20p coins only?\n",
      "\n",
      "For this problem,\n",
      "\n",
      "$$\\eta = 30 X_{10} X_{20} + 20 (1-X_{10}) X_{20}  + 10 X_{10} (1-X_{20})  $$\n",
      "\n",
      "which takes on three values (10,20,30) and only considers the 10p and 20p coins. Here, we'll look for affine functions, $h(\\eta) = a \\eta + b $."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from sympy.abc import a,b\n",
      "\n",
      "eta = X10 * X20 * 30 + X10 * (1-X20) *(10 )+ (1-X10) * X20 *(20 )\n",
      "h = a*eta + b\n",
      "\n",
      "J=S.summation((xi - h)**2 * S.Rational(1,8),(X10,0,1),(X20,0,1),(X50,0,1))\n",
      "\n",
      "sol=S.solve( [S.diff(J,a), S.diff(J,b)],(a,b) )\n",
      "print sol"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "{b: 25, a: 1}\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "This means that\n",
      "\n",
      "$$ \\mathbb{E}(\\xi|\\eta) = 25+ \\eta $$\n",
      "\n",
      "since $\\eta$ takes on only four values, $\\{0,10,20,30\\}$, we can write this out as\n",
      "\n",
      "$$ \\mathbb{E}(\\xi|\\eta=0) = 25  $$\n",
      "$$ \\mathbb{E}(\\xi|\\eta=10) = 35  $$\n",
      "$$ \\mathbb{E}(\\xi|\\eta=20) = 45  $$\n",
      "$$ \\mathbb{E}(\\xi|\\eta=30) = 55  $$\n",
      "\n",
      "The following is  a quick simulation to demonstrate this."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "x=np.random.randint(0,2,(3,5000))  # random samples for 3 coins tossed\n",
      "eta=np.dot(x[:2,:].T,array([10,20])) # sum of 10p and 20p\n",
      "\n",
      "print np.dot(x[:,eta==0].T,array([10,20,50])).mean() # E(xi|eta=0)\n",
      "print np.dot(x[:,eta==10].T,array([10,20,50])).mean()# E(xi|eta=10)\n",
      "print np.dot(x[:,eta==20].T,array([10,20,50])).mean()# E(xi|eta=20)\n",
      "print np.dot(x[:,eta==30].T,array([10,20,50])).mean()# E(xi|eta=30)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "25.1587301587\n",
        "34.3410852713\n",
        "43.7323358271\n",
        "56.6238973536\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Example\n",
      "-----------\n",
      "\n",
      "This is Example 2.3\n",
      "\n",
      "![alt text](files/ex23.jpg)"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Note that \"Lebesgue measure\" on $[0,1]$ just means uniformly distributed on that interval. Also, note the the `Piecewise` object in `sympy` is not complete at this point in its development, so we'll have to work around that in the following."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%pylab inline"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Populating the interactive namespace from numpy and matplotlib\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "x=S.Symbol('x')\n",
      "c=S.Symbol('c')\n",
      "\n",
      "xi = 2*x**2\n",
      "\n",
      "eta=S.Piecewise((1,S.And(S.Gt(x,0),S.Lt(x,S.Rational(1,3)))),  #  0 < x < 1/3\n",
      "                (2,S.And(S.Gt(x,S.Rational(1,3)),S.Lt(x,S.Rational(2,3)))), # 1/3 < x < 2/3,\n",
      "                (0,S.And(S.Gt(x,S.Rational(2,3)),S.Lt(x,1))), \n",
      "                )\n",
      "\n",
      "\n",
      "h = a + b*eta + c*eta**2 \n",
      "J=S.integrate((xi - h)**2 ,(x,0,1))\n",
      "\n",
      "sol=S.solve( [S.diff(J,a), \n",
      "              S.diff(J,b),\n",
      "              S.diff(J,c),\n",
      "              ],\n",
      "              (a,b,c) )\n",
      "print sol\n",
      "\n",
      "print S.piecewise_fold(h.subs(sol))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "{c: 8/9, b: -20/9, a: 38/27}\n",
        "Piecewise((2/27, And(x < 1/3, x > 0)), (14/27, And(x < 2/3, x > 1/3)), (38/27, And(x < 1, x > 2/3)))\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Thus, collecting this result gives:\n",
      "\n",
      "$$ \\mathbb{E}(\\xi|\\eta) = \\frac{38}{27} - \\frac{20}{9}\\eta + \\frac{8}{9} \\eta^2$$\n",
      "\n",
      "which can be re-written as a piecewise function as\n",
      "\n",
      "$$\\mathbb{E}(\\xi|\\eta) =\\begin{cases} \\frac{2}{27} & \\text{for}\\: 0 < x < \\frac{1}{3} \\\\\\frac{14}{27} & \\text{for}\\: \\frac{1}{3} < x < \\frac{2}{3} \\\\\\frac{38}{27} & \\text{for}\\: \\frac{2}{3}<x < 1 \\end{cases}\n",
      "$$\n",
      "\n",
      "The following is a quick simulation to demonstrate this."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "x = np.random.rand(1000)\n",
      "f,ax= subplots()\n",
      "ax.hist(2*x**2,bins=array([0,1/3.,2/3.,1])**2*2,normed=True,alpha=.5)\n",
      "ax.vlines([2/27.,14/27.,38/27.],0,ax.get_ylim()[1],linestyles='--')\n",
      "ax.set_xlabel(r'$2 x^2$',fontsize=18);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEaCAYAAADqqhd6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFXZJREFUeJzt3X+s3Xd93/HnC9esRSUKwVumOoYziEeTlRA6ETpo68Ng\nwkSl0RhaZkqnsAJhkxmbNBGGpvpaCCQmVYsgVepmSUQ6EVcNiJkpP4Q0ThYhCI2WnyNmdoM7OzBv\nQMooYao9v/fHPdyenPie873nfq/vOV8/H9KV7vd8P/d73/nok9f9+nu+5/1NVSFJ6pYXbHYBkqT2\nGe6S1EGGuyR1kOEuSR1kuEtSBxnuktRBU8M9yW1JTiZ5fJX925Lcm+SRJE8kua71KiVJa9LkzP12\nYPeE/XuBh6vqSqAP/E6Sn2qhNknSjKaGe1U9ADwzYch3gAuG318AfK+qTrdQmyRpRm2cYd8C/Ock\n3wZeDPzDFo4pSVqHNsL9o8AjVdVP8krgS0leU1U/HB2UxD4HkjSDqspaf6aNu2XeAPzRsIA/Ab4F\nvOpsA6vKr5a+9u3bt+k1dOXLuXQ+5/lrVm2E+2HgLQBJLmY52J9q4biSpBlNvSyT5E5gF7AtyXFg\nH7AVoKoOAJ8Abk/yKMt/LD5cVd/fuJIlSdNMDfeq2jNl/3eBt7dWkRrp9/ubXUJnOJftcj7nQ9Zz\nTWdNvyipc/W7JKkrklCb9IaqJGnOGO6S1EGGuyR1kOEuSR1kuEtSBxnuktRBhrskdZDhLkkdZLhL\nUgcZ7pLUQYa7JHWQ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Gq85K8APg0cFdVfWpk10ur\n6o+H378cOFNVXxi+ebqrqh4417VKbfENVXVekn8LvAR4f62y4JPcBGyvqr9/TouTNohvqKrTkvwL\n4IdV9b6qqiQvGz5wfNybgcG5rU7aOIa7OivJu1i+1PKxkZc/AJxJsiXJ30vygiQ/B7wKuH/kZz98\njsuVWuU1d3VSkrcCHwI+n+QjP3mZ5U+Xnk7yz1i+C+Yy4GrgWeDE8Gd/Dfjmua9aao/X3NU5SV4K\nHANexHKgj/pCVb0jyWuAfwUcAR4FLgDeNPy5Y1V1xzkrWNoAhrskdZDX3CWpgwx3Seogw12SOshw\nl6QOMtwlqYMMd0nqIMNdkjrIcJekDjLcJamDDHdJ6iDDXZI66P8DNocSzQ3ikt4AAAAASUVORK5C\nYII=\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f75050>"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "This plot shows the intervals that correspond to the respective domains of $\\eta$ with the vertical dotted lines showing the $\\mathbb{E}(\\xi|\\eta) $ for that piece."
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Example\n",
      "-----------\n",
      "\n",
      "This is Example 2.4\n",
      "\n",
      "![alt text](files/ex24.jpg)"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "x,a=S.symbols('x,a')\n",
      "\n",
      "xi = 2*x**2\n",
      "\n",
      "half = S.Rational(1,2)\n",
      "\n",
      "eta_0=S.Piecewise((2, S.And(S.Ge(x,0), S.Lt(x,half))), \n",
      "                  (0, S.And(S.Ge(x,half), S.Le(x,1))))\n",
      "\n",
      "eta_1=S.Piecewise((0, S.Lt(x,half)),\n",
      "                  (x, S.And(S.Ge(x,half),S.Le(x,1))))\n",
      "\n",
      "\n",
      "\n",
      "v=S.var('b:3') # coefficients for quadratic function of eta\n",
      "h = a*eta_0 + (eta_1**np.arange(len(v))*v).sum()\n",
      "J=S.integrate((xi - h)**2 ,(x,0,1))\n",
      "sol=S.solve([J.diff(i) for i in v+(a,)],v+(a,))\n",
      "hsol = h.subs(sol)\n",
      "f=S.lambdify(x,hsol,'numpy')\n",
      "print S.piecewise_fold(h.subs(sol))\n",
      "t = np.linspace(0,1,51,endpoint=False)\n",
      "\n",
      "fig,ax = subplots()\n",
      "ax.plot(t, 2*t**2,label=r'$\\xi=2 x^2$')\n",
      "ax.plot(t,[f(i) for i in t],'-x',label=r'$\\mathbb{E}(\\xi|\\eta)$')\n",
      "ax.plot(t,map(S.lambdify(x,eta_0+eta_1),t),label=r'$\\eta(x)$')\n",
      "ax.set_ylim(ymax = 2.3)\n",
      "ax.grid()\n",
      "ax.legend(loc=0);\n",
      "#ax.plot(t,map(S.lambdify(x,eta),t))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Piecewise((0, x < 1/2), (2*x**2, And(x <= 1, x >= 1/2)))\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 13,
       "text": [
        "<matplotlib.legend.Legend at 0x840a310>"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD7CAYAAAB+B7/XAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcTfX/wPHXJ2Rku2Qp65BskS2SIVMkZsoaEmpo8Uuk\nTcn0pU2RlKQkKlokhDQjuykmgzCoLDFj38JMwkxm+fz+ODNzx6x37tx7z7l33s/H4z7Gvffcc9/e\nnXl3vM/nfD5Ka40QQgjfcY3ZAQghhHAtKexCCOFjpLALIYSPkcIuhBA+Rgq7EEL4GCnsQgjhY4p7\n6ouUUjKuUgghnKC1VgXZ3qNn7FpreWjN+PHjTY/BKg/JheRCcpH3wxnSijHBoUOHzA7BMiQXdpIL\nO8lF4UhhF0IIHyOF3QQhISFmh2AZkgs7yYWd5KJwlLM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6O/X78ALRXShVTSl2HcaHsTw/H6QmO5GIvxsyypPWTGwAxHo3SOgpU\nN116xq7lhqYMjuQCGAdUAGakna0maa3bmBWzOziYhyLBwd+PvUqpFcAuIBVjEj6fK+wOHhdvAV8o\npXZinIS+qLU+b1rQbqSU+hboCFRSSh0FxmO05Zyqm3KDkhBC+BiX36AkhBDCXFLYhRDCx0hhF0II\nHyOFXQghfIwUdiGE8DFS2IUQwsdIYRdCCB8jhV0IIXzM/wMwVLXJbGPMdAAAAABJRU5ErkJggg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x830c350>"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "The figure shows the $\\mathbb{E}(\\xi|\\eta)$ against $\\xi$ and $\\eta$. Note that $\\xi= \\mathbb{E}(\\xi|\\eta)= 2 x^2$ when $x\\in[0,\\frac{1}{2}]$ . Assembling the solution gives,\n",
      "\n",
      "$$\\mathbb{E}(\\xi|\\eta) =\\begin{cases} \\frac{1}{6} & \\text{for}\\: 0 \\le x < \\frac{1}{2} \\\\ 2 x^2 & \\text{for}\\: \\frac{1}{2} < x \\le 1 \\end{cases}$$"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "This example warrants more a more detailed explanation since $\\eta$ is more complicated. The first question is why did we choose $h(\\eta)$ as a quadratic function? Since $\\xi$ is a squared function of $x$ and since $x$ is part of $\\eta$, we chose a quadratic function so that $h(\\eta)$ would contain a $x^2$ in the domain where $\\eta=x$. The motivation is that we are asking for a function $h(x)$ that most closely approximates $2x^2$. Well, obviously, the exact function is $h(x)=2 x^2$! Thus, we want $h(x)=2 x^2$ over the domain where $\\eta=x$, which is $x\\in[\\frac{1}{2},1]$ and that is exactly what we have.\n",
      "\n",
      "We could have used our inner product by considering two separate functions,\n",
      "\n",
      "$\\eta_1 (x) = 2$ \n",
      "\n",
      "where $x\\in [0,\\frac{1}{2}]$ and\n",
      "\n",
      "$$\\eta_2 (x) = x$$ \n",
      "\n",
      "where $x\\in [\\frac{1}{2},1]$. Thus, at the point of projection, we have\n",
      "\n",
      "$$ \\mathbb{E}((2 x^2 - 2 c) \\cdot 2) = 0$$\n",
      "\n",
      "which leads to\n",
      "\n",
      "$$\\int_0^{\\frac{1}{2}} 2 x^2 \\cdot 2 dx = \\int_0^{\\frac{1}{2}} c 2 \\cdot 2   dx $$\n",
      "\n",
      "and a solution for $c$,\n",
      "\n",
      "$$ c = \\frac{1}{12} $$\n",
      "\n",
      "Assembling the solution for $x\\in[0,\\frac{1}{2}]$ gives\n",
      "\n",
      "$$ \\mathbb{E}(\\xi|\\eta) =  \\frac{2}{12}$$\n",
      "\n",
      "We can do the same thing for the other piece, $\\eta_2$,\n",
      "\n",
      "$$ \\mathbb{E}((2 x^2 - c x^2) \\cdot x) = 0$$\n",
      "\n",
      "which, by inspection, gives $c=2$. Thus, for $x\\in[\\frac{1}{2},1]$ , we have\n",
      "\n",
      "$$ \\mathbb{E}(\\xi|\\eta)= 2 x^2$$  \n",
      "\n",
      "which is what we had before."
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Example\n",
      "-----------\n",
      "\n",
      "This is Exercise 2.6\n",
      "\n",
      "![alt text](files/ex26.jpg)"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "x,a=S.symbols('x,a')\n",
      "\n",
      "xi = 2*x**2\n",
      "eta = 1 - abs(2*x-1)\n",
      "\n",
      "half = S.Rational(1,2)\n",
      "\n",
      "eta=S.Piecewise((1+(2*x-1), S.And(S.Ge(x,0),S.Lt(x,half))),\n",
      "                (1-(2*x-1), S.And(S.Ge(x,half),S.Lt(x,1))))\n",
      "\n",
      "v=S.var('b:3') # assume h is quadratic in eta\n",
      "\n",
      "h = (eta**np.arange(len(v))*v).sum()\n",
      "\n",
      "J=S.integrate((xi - h)**2 ,(x,0,1))\n",
      "sol=S.solve([J.diff(i) for i in v],v)\n",
      "hsol = h.subs(sol)\n",
      "\n",
      "print S.piecewise_fold(h.subs(sol))\n",
      "\n",
      "t = np.linspace(0,1,51,endpoint=False)\n",
      "\n",
      "fig,ax = subplots()\n",
      "fig.set_size_inches(5,5)\n",
      "\n",
      "ax.plot(t, 2*t**2,label=r'$\\xi=2 x^2$')\n",
      "ax.plot(t,[hsol.subs(x,i) for i in t],'-x',label=r'$\\mathbb{E}(\\xi|\\eta)$')\n",
      "ax.plot(t,map(S.lambdify(x,eta),t),label=r'$\\eta(x)$')\n",
      "ax.legend(loc=0)\n",
      "ax.grid()\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Piecewise((2*x**2 - 2*x + 1, And(x < 1/2, x >= 0)), (2*x + (-2*x + 2)**2/2 - 1, And(x < 1, x >= 1/2)))\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAT8AAAE4CAYAAAAto/QTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXd4FOX2x7/vT8SgAgFBhECIUgSUC1IDAUGRIhEQuMLl\ngtLUACoIgghRyFUCUkUEKQGkCaEoLSBFTCChE0go0mJCkU6yS0tCSc7vj0liym62zeyUPZ/nmQdm\n592Zc2Zmv3nPeZsgIjAMw3ga/6e2AQzDMGrA4scwjEfC4scwjEfC4scwjEfC4scwjEfC4scwjEdS\nqPgJISoJISKFECeEEMeFEIOtlJshhDgrhIgXQryijKkMwzDyUcTG8YcAhhJRnBDiaQCxQojtRHQy\nu4AQoj2AqkRUTQjRGMBsAP7KmcwwDOM6hdb8iOgqEcVl/f8ugJMAKuQr1hHA4qwy+wF4CyHKKWAr\nwzCMbNid8xNC+AF4BcD+fId8AFzMtf83gIquGsYwDKMkdolfVsi7BsCQrBpggSL59nnMHMMwmsZW\nzg9CiMcB/AJgGRGts1DkEoBKufYrZn2W/zwsiAzDKAIR5a+A2cRWa68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dERVWTdca9vhXH1J/TkDK\nGb0phHhIRBvcY6JL2OPfRQA3iSgNQJoQYheAOgD0IH72+NcUQCgAENFfQogkAC9C6s+rdxzXFZmT\nkkUA/AUp6VoUths8/KGTRgE7ffOFlHT2V9teJfzLV/4nAF3Utlvm51cDwO+QGg+eBHAMQC21bZfR\nv2kAxmb9vxwkcSyttu0O+OgH+xo87NIVWWt+ZOBO0fb4BmAMgFIAZmfVjh4SUSO1bHYEO/3TLXa+\nm6eEEFsAHAWQCSCMiP5Uz2r7sfP5jQfwkxAiHlK+/3MiSlHNaAcQQqwA0AJAGSHERQBjIaUpnNYV\n7uTMMIxHov7qbQzDMCrA4scwjEfC4scwjEfC4scwjEfC4scwjEfC4scwjEfC4scwjEfC4scwjEfy\n/7MSuP4OUIeAAAAAAElFTkSuQmCC\n",
       "text": [
        "<matplotlib.figure.Figure at 0x8414510>"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "The figure shows that the $\\mathbb{E}(\\xi|\\eta)$ is continuous over the entire domain. The code above solves for the conditional expectation using optimization assuming that $h$ is a quadratic function of $\\eta$, but we can also do it by using the inner product. Thus,\n",
      "\n",
      "$$ \\mathbb{E}\\left((2 x^2 - h(\\eta_1(x)) )\\eta_1(x)\\right)= \\int_0^{\\frac{1}{2}} (2 x^2 - h(\\eta_1(x)) )\\eta_1(x)  dx = 0$$\n",
      "\n",
      "where $\\eta_1 = 2x $ for $x\\in [0,\\frac{1}{2}]$. We can re-write this in terms of $\\eta_1$ as\n",
      "\n",
      "$$ \\int_0^1 \\left(\\frac{\\eta_1^2}{2}-h(\\eta_1)\\right)\\eta_1 d\\eta_1$$\n",
      "\n",
      "and the solution jumps right out as $h(\\eta_1)=\\frac{\\eta_1^2}{2}$. Note that $\\eta_1\\in[0,1]$. Doing the same thing for the other piece,\n",
      "\n",
      "$$ \\eta_2  = 2 - 2 x, \\hspace{1em} \\forall x\\in[\\frac{1}{2},1]$$ \n",
      "\n",
      "gives,\n",
      "\n",
      "$$ \\int_0^1 \\left(\\frac{(2-\\eta_2)^2}{2}-h(\\eta_2)\\right)\\eta_2 d\\eta_2$$\n",
      "\n",
      "and again, the optimal $h(\\eta_2)$ jumps right out as\n",
      "\n",
      "$$  h(\\eta_2) = \\frac{(2-\\eta_2)^2}{2} , \\hspace{1em} \\forall \\eta_2\\in[0,1]$$ \n",
      "\n",
      "and since $\\eta_2$ and $\\eta_2$ represent the same variable over the same domain we can just add these up to get the full solution:\n",
      "\n",
      "$$ h(\\eta) = \\frac{1}{2} \\left( 2 - 2 \\eta + \\eta^2\\right) $$\n",
      "\n",
      "and then back-substituting each piece for $x$ produces the same solution as `sympy`."
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Example\n",
      "-----------\n",
      "\n",
      "This is Exercise 2.14\n",
      "\n",
      "![alt text](files/ex214.jpg)"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "x,a=S.symbols('x,a')\n",
      "half = S.Rational(1,2)\n",
      "\n",
      "xi = 2*x**2\n",
      "eta=S.Piecewise((2*x,    S.And(S.Ge(x,0),S.Lt(x,half))), \n",
      "                ((2*x-1),S.Ge(x,half)),\n",
      "               )\n",
      "\n",
      "v=S.var('b:3')\n",
      "\n",
      "h = (eta**np.arange(len(v))*v).sum()\n",
      "\n",
      "J=S.integrate((xi - h)**2 ,(x,0,1))\n",
      "sol=S.solve([J.diff(i) for i in v],v)\n",
      "hsol = h.subs(sol)\n",
      "\n",
      "print S.piecewise_fold(h.subs(sol))\n",
      "\n",
      "t = np.linspace(0,1,51,endpoint=False)\n",
      "\n",
      "fig,ax = subplots()\n",
      "fig.set_size_inches(5,5)\n",
      "\n",
      "ax.plot(t, 2*t**2,label=r'$\\xi=2 x^2$')\n",
      "ax.plot(t,[hsol.subs(x,i) for i in t],'-x',label=r'$\\mathbb{E}(\\xi|\\eta)$')\n",
      "ax.plot(t,map(S.lambdify(x,eta),t),label=r'$\\eta(x)$')\n",
      "ax.legend(loc=0)\n",
      "ax.grid()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Piecewise((2*x**2 + x + 1/4, And(x < 1/2, x >= 0)), (x + (2*x - 1)**2/2 - 1/4, x >= 1/2))\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAT8AAAE4CAYAAAAto/QTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXd4FFXbh++RnlAChqJUBVQQFOSVqlRfQRBDERAFwfah\nFBEEFVGxIdWGCNKrGDpiolSJAtKl9xI6UlKQkpD2fH9MNu8mpOzOzu7sbs59XXPB7s6eec7u5jfn\n+Z2miQgKhUKR27jD6gAUCoXCCpT4KRSKXIkSP4VCkStR4qdQKHIlSvwUCkWuRImfQqHIlWQrfpqm\nldc0bZ2mafs1TdunadqbWZw3TtO0o5qm7dY0rbZ7QlUoFArzyJvD64nAABHZpWlaYWCHpmmrReSg\n7QRN01oDVUSkqqZp9YCJQH33haxQKBSuk23LT0T+EZFdqf+/DhwE7s5w2jPArNRztgBBmqaVdkOs\nCoVCYRoOe36aplUCagNbMrxUFjhj9/gsUM7VwBQKhcKdOCR+qSnvIqB/agvwtlMyPFZz5hQKhVeT\nk+eHpmn5gMXAXBFZlskp54Dydo/LpT6XsRwliAqFwi2ISMYGWI7k1NurAdOAAyLyTRanLQdeTD2/\nPhArIhezCNBvj2HDhlkeg6qbql9urJ9Rcmr5NQK6AXs0TduZ+tz7QIVUMZskIr9qmtZa07RjwA3g\nJcPR+DAnT560OgS34c91A1W/3Eq24iciG3DAFxSRvqZFpFAoFB5AzfAwiZ49e1odgtvw57qBql9u\nRXMlZ3bqQpomnrqWQqHIPWiahpjd4eEJNE1ThwuHJ4iIiPDIdaxC1S93kuNQF0+gWoTG8JT4KRT+\niOVpb2qT1SMx+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xxQ3u5xeXQFzu6c\ncqnPeTuO1I3UTo4pQCsRya6Z7m04Ur866OM5QfeMntI0LVFElnsmRJdwpH5ngCsiEgfEaZr2J/Aw\n4Avi50j9GgLDAUTkuKZpkcD96ON5fR3ndcVkUzIvcBzddM1Pzh0e9fGRTgEH61YB3XSub3W87qhf\nhvNnAB2sjtvk7+8BYA1650EAsBeobnXsJtbvK2BY6v9Lo4tjCatjd6KOlXCsw8MhXTG15Sd+PCja\nkboBHwHFgYmpraNEEalrVczO4GD9fBYHf5uHNE1bAewBUoApInLAuqgdx8Hv7wtghqZpu9H9/ndE\nJNqyoJ1A07SfgCZAsKZpZ4Bh6DaFYV1Rg5wVCkWuxPrd2xQKhcIClPgpFIpciRI/hUKRK1Hip1Ao\nciVK/BQKRa5EiZ9CociVKPFTKBS5EiV+CoUiV/L/msea8Ip5xD4AAAAASUVORK5CYII=\n",
       "text": [
        "<matplotlib.figure.Figure at 0x81753b0>"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "As before, using the inner product for this problem, gives:\n",
      "\n",
      "$$ \\int_0^1 \\left(\\frac{\\eta_1^2}{2}-h(\\eta_1)\\right)\\eta_1 d\\eta_1=0$$\n",
      "\n",
      "and the solution jumps right out as \n",
      "$$h(\\eta_1)=\\frac{\\eta_1^2}{2}  , \\hspace{1em} \\forall \\eta_1\\in[0,1$$\n",
      "\n",
      "where $\\eta_1(x)=2x$. Doing the same thing for $\\eta_2=2x-1$ gives,\n",
      "\n",
      "$$ \\int_0^1 \\left(\\frac{(1+\\eta_2)^2}{2}-h(\\eta_2)\\right)\\eta_1 d\\eta_2=0$$\n",
      "\n",
      "with  \n",
      "\n",
      "$$h(\\eta_2)=\\frac{(1+\\eta_2)^2}{2} , \\hspace{1em} \\forall \\eta_2\\in[0,1]$$ \n",
      "\n",
      "and then adding these up as before gives the full solution:\n",
      "\n",
      "$$ h(\\eta)= \\frac{1}{2} +\\eta + \\eta^2$$ \n",
      "\n",
      "Back-substituting each piece for $x$ produces the same solution as `sympy`."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "xs = np.random.rand(100)\n",
      "print np.mean([(2*i**2-hsol.subs(x,i))**2 for i in xs])\n",
      "print S.integrate((2*x**2-hsol)**2,(x,0,1)).evalf()\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "0.282679822464177\n",
        "0.270833333333333\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Summary"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "We worked out some of the great examples in Brzezniak's book using our methods as a way to show multiple ways to solve the same problem. In particular, comparing Brzezniak's more measure-theoretic methods to our less abstract techniques is a great way to get a handle on those concepts which you will need for more advanced study in stochastic process. \n",
      "            \n",
      "As usual, the corresponding [IPython Notebook](www.ipython.org) notebook for this post  is available for download [here](https://github.com/unpingco/Python-for-Signal-Processing/blob/master/Conditional_expectation_MSE_Ex.ipynb)  \n",
      "\n",
      "Comments and corrections welcome!"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "References\n",
      "---------------\n",
      "\n",
      "* Brzezniak, Zdzislaw, and Tomasz Zastawniak. Basic stochastic processes: a course through exercises. Springer, 2000."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}